#pragma once


#include <vector>
#include <map>
#include "meshType.h"
#include "parserHelper.h"
#include <iostream>



namespace MeshUtils {


class TetgenParser
{
	private:
		const char* filename;
		std::map<unsigned int, unsigned int> gmshToInternal;
	public:
		inline TetgenParser(const char* file) : filename(file) {};
		void load(std::vector<MeshUtils::Vector3>& nodes, std::vector<MeshUtils::Element>& elts, unsigned int& nbNodes, unsigned int& nbElts);
		Mesh load(void);
		//Mesh loadBoundary(void);
	private:
		bool parseNode(std::ifstream& source, unsigned int& idx, double& x, double& y, double& z);
		bool parseElement(std::ifstream& source, unsigned int& idx, std::vector<unsigned int>& nodesList);
};
}//namespace
